<template>
  <div>
    <headerXX :name="title"></headerXX>
    <div class="pull-refresh">
      <div class="ul">
        <div v-for="(item, index) in datalist" :key="index">
          <div class="titleXX WZ_size_16">
            {{ item.classifyName }}
          </div>
          <div class="li">
            <div
              class="CD"
              v-for="(item2, index2) in item.siteClassifyList"
              :key="index2"
            >
              <div>
                {{ item2.siteDtoList.enableFlag }}
              </div>
              <div
                v-if="item2.siteDtoList[0].enableFlag == 'N'"
                @click="Goindex(item2.siteDtoList[0])"
              >
                <van-image
                  class="liimg"
                  :src="item2.siteDtoList[0].siteImage"
                  mode=""
                ></van-image>
                <div class="litext">
                  {{ item2.classifyName }}
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import headerXX from "../../components/title.vue";
import { getSiteInfoAllList } from "@/api/realAssets/icsharedstation/home";
import {
  getpersonalInformation,
  setpersonalInformation,
} from "../../common/RYXX";
export default {
  components: { headerXX },
  data() {
    return {
      title: "更多服务",
      datalist: [],
    };
  },
  created() {},
  mounted() {
    this.getLIst()
  },
  methods: {
    //跳转页面
    Goindex(item) {
      localStorage.setItem("siteData", JSON.stringify(item));
     if (item.forwordUrl == "icsharedstation_XCFW_index") {
        this.$router.push({
          name: "rvicsharedstation-index",
          query: {
            id: 1,
          },
        });
        return;
      }
      if (item.forwordUrl == "icsharedstation_CPYY_index") {
        this.$router.push({
          name: "rvicsharedstation-index",
          query: {
            id: 2,
          },
        });
        return;
      }
      this.$router.push(item.forwordUrl);
    },
    //获取页面
    getLIst() {
      getSiteInfoAllList({
        postId: JSON.parse(getpersonalInformation()).postId,
      }).then((res) => {
        if (res.resultMessage == "SUCCESS" && res.resultCode == "1") {
          this.datalist = res.data;
        }
      });
    },
  },
};
</script>

<style lang="less" scoped>
@import "../../static/css/index.less";
@import "../../static/css/GYcSS.less";
.pull-refresh {
  background: url("../../static/GDBJ.png") no-repeat;
  background-size: 100% 100%;
}
.title {
  position: relative;
  padding: 10px;
  padding-bottom: 0;
  margin-top: 10px;

  .title_WZ {
    position: absolute;
    left: 50%;
    top: 15px;
    transform: translate(-50%, 0px);
    font-size: 18px;
    font-weight: 700;
  }
}

.ul {
  width: 90%;
  //margin: 40rpx auto;
  // background: #fff;
  padding: 0 10px;
  margin-top: 10px;
  .titleXX {
    margin: 5px;

    color: rgb(128, 128, 128);
  }
  .li {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 10px;
    .CD {
      margin: 10px 0;
      width: 20%;
    }
  }
}

.liimg {
  width: 44px;
  height: 54px;
  margin: 0 auto;
  display: block;
}

.litext {
  text-align: center;
  color: rgb(53, 53, 53);
  font-size: 12px;
}
</style>
